﻿Imports System.Data.SqlClient

Module NETSIS_SKELETON
    'Dim Citra As New Citra.Herramientas
    'Dim ServidorCitra As String = "Server=tcp:ausl.mine.nu:1433;Database=NETSIS_SKELETON;user id = SA;password = Compac123;"
    Dim ServidorCitra As String = "data source = 201.163.91.243; initial catalog = NETSIS_SKELETON; user id = sa; password = Ausl4321OPTRA"
    Friend FechaLiberacion As String
    Friend Function VerificaVersion() As String
        Dim cnnConn As New SqlConnection
        Dim strRetVal As String = ""

        Try

            cnnConn.ConnectionString = ServidorCitra
            cnnConn.Open()

            Dim cmdBuscar As New SqlCommand
            cmdBuscar.CommandTimeout = 0
            cmdBuscar.CommandText = "SELECT VERSION FROM CITRA_PILESO"
            cmdBuscar.Connection = cnnConn

            strRetVal = cmdBuscar.ExecuteScalar

        Catch ex As SqlException
            MsgBox(ex.Message, MsgBoxStyle.Information, "Mensaje de la BD")
        Finally
            If cnnConn.State = ConnectionState.Open Then
                cnnConn.Close()
            End If
        End Try

        If strRetVal Is Nothing Then
            Return ""
        Else
            Return strRetVal
        End If

    End Function
    Friend Function Fecha() As String
        Dim cnnConn As New SqlConnection
        Dim strRetVal As String = ""

        Try
            cnnConn.ConnectionString = ServidorCitra
            cnnConn.Open()

            Dim cmdBuscar As New SqlCommand
            cmdBuscar.CommandTimeout = 0
            cmdBuscar.CommandText = "SELECT FECHA FROM CITRA_PILESO"
            cmdBuscar.Connection = cnnConn

            strRetVal = cmdBuscar.ExecuteScalar

        Catch ex As SqlException
            MsgBox(ex.Message, MsgBoxStyle.Information, "Mensaje de la BD")
        Finally
            If cnnConn.State = ConnectionState.Open Then
                cnnConn.Close()
            End If
        End Try

        If strRetVal Is Nothing Then
            Return ""
        Else
            Return strRetVal.Trim
        End If

    End Function
End Module
